package legumes.shared.domain;

import java.io.Serializable;

import javax.persistence.Id;

public class Receipe implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id private long id = -1;
	private String name = "";
	private String text = "";

	public Receipe() {
	}

	public long getId() {
		return id;
	}

	public void setId(long id_) {
		id = id_;
	}

	@Override
	public boolean equals(Object obj_) {
		return getId() == ((Receipe) obj_).getId();
	}

	public Receipe copy() {
		Receipe r = new Receipe();
		r.setName(getName());
		r.setText(getText());
		return r;
	}

	public Receipe(String name, String text) {
		setName(name);
		setText(text);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Override
	public String toString() {
		return "[Receipe name=" + getName() + " text=" + getText() + "]";
	}
}
